package com.csii.modules.project.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import com.csii.modules.project.mapper.entity.Project;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Description: 项目
 * @Author: power-stdio
 * @Date:   2020-11-05
 * @Version: V1.0
 */
public interface ProjectMapper extends BaseMapper<Project> {
    /**
     * 根据 userName 查询
     * @param userName
     * @return
     */
    @Select("select distinct pro.* from project pro inner JOIN project_user pro_user on pro.id = pro_user.pro_id and pro_user.user_name = #{userName} and pro_user.status=1 and pro_user.start_date<=now() and pro_user.end_date>=now()")
    List<Project> queryList(@Param("userName") String userName);
}
